package com.vcredit.creditcat.web.app;

import javax.servlet.http.HttpServletRequest;

import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import com.alibaba.dubbo.config.annotation.Reference;
import com.vcredit.creditcat.api.ITaoBaoProcessManager;
import com.vcredit.creditcat.dto.emallcredit.TaobaoProcessInDto;
import com.vcredit.creditcat.model.Cust;
import com.vcredit.creditcat.vo.JsonResult;
import com.vcredit.framework.annotation.Log;

@RestController
@RequestMapping(value = "/taobao")
public class TaobaoProcessController extends BaseCreditCatController {

	@Reference(version = "1.0")
	private ITaoBaoProcessManager taoBaoProcessManager;

	/***
	 * 淘宝登录接口
	 * @param param
	 * @param request
	 * @return
	 * @throws Exception
	 */
	@Log
	@RequestMapping(value = "/login")
	@SuppressWarnings("rawtypes")
	public JsonResult login(@RequestBody TaobaoProcessInDto param, HttpServletRequest request) throws Exception {
		Cust cust = super.getCust(request);
		taoBaoProcessManager.login(param, cust);
		return JsonResult.SuccessResponse(null);
	}
}
